using System;
using System.Collections;
	
using System.Data ;
using WP.DB;
using WP.MF.DataEntity; 
using WP.Commons;

namespace WP.MF.DataAccess
{
    public class MSysRemarkDAL : IDataAccess
    {
        public MSysRemarkDAL()
		{
		}

        #region Select List
        public string SQLList(int iParameter)
        {
            string strSQL = @"select RecID,RemarkNo,RemarkDesc from mSysRemark ORDER BY RemarkNo ";
            return strSQL;
        }
        #endregion

        #region Fields
        public string Fields
        {
            get
            {
                return @"RemarkNo,RemarkDesc";
            }
        }
        #endregion

        #region Insert table
        public void InsertMSysRemark(DBAccess dBAccess, MSysRemarkDEL mSysRemarkDEL)
        {
            string strSql = string.Empty;

            DataRow dr = mSysRemarkDEL.Tables[MSysRemarkDEL.TABLENAME_MSYSREMARK].Rows[0];

            strSql = BaseFunctions.GenerateSqlForDataAccess(Fields, MSysRemarkDEL.TABLENAME_MSYSREMARK, dr, FormStatus.AddNew);

            dr["RecId"] = dBAccess.GetIntValue(strSql);
        }
        #endregion

        #region Update MSysRemark
        public void UpdateMSysRemark(DBAccess dBAccess, MSysRemarkDEL mSysRemarkDEL)
        {
            string strSql = string.Empty;
            DataRow dr = mSysRemarkDEL.Tables[0].Rows[0];

            strSql = BaseFunctions.GenerateSqlForDataAccess(Fields, MSysRemarkDEL.TABLENAME_MSYSREMARK, dr, FormStatus.Update);

            dr[MSysRemarkDEL.RECSTAMP] = dBAccess.GetObjectValue(strSql);
        }
        #endregion

        #region Delete MSysRemark by Key
        public void DeleteMSysRemark(DBAccess dBAccess, string strRecId)
        {
            string strSql = "";

            strSql = "delete from MSysRemark WHERE RecId = " + strRecId;

            dBAccess.ExecuteSql(strSql);
        }
        #endregion
    }
}
